info = "I? love ?? the ?great ? ?wall in ?beijing"

import re 

def rep_func(data):
    print(data[0:1])
    return data[0:1] + data[1:]

result = re.sub(r'\?\s*(\w+)?',rep_func(r'\1'), info) 
print(result)